<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContextPath()}+'/'">
	<meta charset="UTF-8">
	<title>购物车</title>
    <script type="text/javascript" src="js/jquery.min.js"></script>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.css">
    <style type="text/css"></style>
    <script type="text/javascript">
        function checkall() {
            var booksIdALL = document.getElementById("booksIdALL");
            var booksIds = document.getElementsByName("booksId");
            for (var i = 0; i < booksIds.length; i++) {
                booksIds[i].checked = booksIdALL.checked;
            }
        }

        function todel(id,time) {
            if (confirm("是否确认删除?")) {
                location.href = "shop/delById?bookId=" + id+"&time="+time;
            }
        }

    </script>
</head>
<body>


    </div>
	<div class="container">
        <div class="row" style="height: 80px;width: 100%;
        text-align: center;line-height: 80px;background-color: #f2f2f2;"> <h1>我的购物车</h1></div>
    	<div class="row">
        <form action="order/buyShop" method="post" name="formSubmit">
    		<table class="table">
    			<tr>
                    <th><input type="checkbox" name="booksIdALL" id="booksIdALL" onclick="checkall()">
                    全选</th>    
    				<th>书名</th>
                    <th>作者</th>
    				<th>金额</th>
    				<th>订单数量</th>
    				<th>状态0：未支付1：已支付</th>
    				<th>操作</th>
    			</tr>
                <tr th:each="myShop:${myShopList}">
                    <td><input type="checkbox" name="booksId" th:value="${myShop.myShop_bookId}"></input></td>
                    <td th:text="${myShop.myShop_bookName}">书名一</td>
                    <td th:text="${myShop.myShop_bookWriter}">作者</td>
                    <td th:text="${myShop.myShop_price}">2</td>
                    <td th:text="${myShop.myShopNumber}">2</td>
                    <td th:text="${myShop.myShopStatus}">0</td>
                    <td><a href="javascript:;" th:onclick="todel([[${myShop.myShop_bookId}]],[[${myShop.myShopData}]])">删除</a></td>
                </tr>

                <tr>
                <td></td>
                <td><a href="user/own">查看历史账单</a></td>
                <td><input type="submit" value="购买"></input></td>
                <td><a href="shop/deleteAll">清空</a></td>
                <td></td>
                <td></td>
                </tr>
    		</table>
        </form>
    	</div>
</body>
</html>